import request, {Method} from "@/plugins/request.js";

// 获取首頁楼层装修數据
export function indexData(params) {
    const num = params
    return request({
        url: "/buyer/other/pageData/getIndex/" + num,
        method: Method.GET,
        needToken: false
    });
}

// 获取自動發券
export function getAutoCoup() {
    return request({
        url: "/buyer/promotion/coupon/activity",
        method: Method.GET,
        needToken: true,
    });
}

/**
 * 获取店铺楼层數据
 */
export function getFloorStoreData(params) {
    return request({
        url: `/buyer/other/pageData?pageClientType=PC`,
        method: "get",
        params,
    });
}

/**
 * 楼层装修數据
 * @param pageClientType 客戶端類型,可用值:PC,H5,WECHAT_MP,APP
 * @param pageType 頁面類型,可用值:INDEX,STORE,SPECIAL
 */
export function pageData(params) {
    return request({
        url: `/buyer/other/pageData`,
        method: Method.GET,
        needToken: false,
        params,
    });
}

/**
 * 刷新token
 */
export function handleRefreshToken(token) {
    return request({
        url: `/buyer/passport/member/refresh/${token}`,
        method: Method.GET,
        needToken: false,
    });
}

/**
 * 獲取底部圖片
 */
export function handleFindFoot(storeId) {
    return request({
        url: `/buyer/store/store/foot/${storeId}`,
        method: Method.GET,
        needToken: false,
    });
}

export function handleCarousel() {
  return request({
    url: `/buyer/store/store/carousel`,
    method: Method.GET,
    needToken: false,
  });
}

// /**
//  * 获取店铺楼层數据
//  */
// export function getFloorStoreData(params) {
//   return request({
//     url: `/buyer/other/pageData?pageClientType=PC`,
//     method: "get",
//     params,
//   });
// }
